import { PageType } from "../../../../types/global";
import { apiRolePage } from "../../../../api/system/role";


export function usePagination() {
    const initGetList = (fn: (pageData?: PageType) => Promise<any>) => {
        let oldPageData: PageType = { page: 1, size: 10 };
        return async function (pageData?: PageType | undefined) {
            pageData ? oldPageData = pageData : pageData = oldPageData;
            return await fn(pageData);
        }
    };
    return { initGetList }
}

